package com.zm.shop.feign;

import com.zm.shop.common.entity.UserEntity;
import com.zm.shop.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "shop-03-user",path = "/users") //监视shop-03-user服务下的/user路径
public interface UserService {

    @PostMapping("/findUser")
    UserEntity findUser(@RequestParam("field") String field, @RequestParam("value") String value);

    @PostMapping("/save")
    R register(UserEntity userEntity);

    @GetMapping("/queryUser")
    UserEntity queryUser(@RequestParam("name") String name);

    @RequestMapping("/update")
    void updateById(UserEntity userEntity);
}
